#pragma once
#include "TinyMsg.h"

#include "AnalogPhone.h"
#include "AnalogTrunk.h"

using namespace TinyCC::msg;
namespace HAL{

class CTinyDevicePool
{
public:
	CTinyDevicePool(void);
	virtual ~CTinyDevicePool(void);
	void init();
	CAnalogPhone* GetExtensionByID(string deviceID);
	CAnalogTrunk* GetTrunkByID(string deviceID);
	void ProcessReceivedMsg(CTinyMsg& inMsg,CTinyMsg& OutMsg);
	std::string GetDeviceID(std::string CardType,std::string CardSN,std::string ChannelID,std::string DeviceType);
	
private:
	std::map<string,CAnalogTrunk*> m_aTrunks;
	std::map<string,CAnalogPhone*> m_aPhones;
};

}